package com.kong.meirimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kong.common.utils.PageUtils;
import com.kong.meirimall.product.entity.CategoryEntity;
import com.kong.meirimall.product.vo.Catalog2Vo;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author kong
 * @email kong@gmail.com
 * @date 2024-10-03 18:13:07
 */
public interface CategoryService extends IService<CategoryEntity> {

    List<CategoryEntity> listWithTree();

    PageUtils queryPage(Map<String, Object> params);

    void removeMenueByIds(List<Long> list);
    //找到 catalogId 的完整路径 [父/子/孙子]
    Long[] findCatelogPath(Long catalogId);

    void updateCascade(CategoryEntity category);

    List<CategoryEntity> getLevel1Categorys();

    Map<String, List<Catalog2Vo>> geCatelogJson();

    // 从数据库查询 三级分类 并存入缓存
    Map<String, List<Catalog2Vo>> geCatelogJsonFromDb();

    // 从数据库查询 三级分类 并存入缓存
    Map<String, List<Catalog2Vo>> geCatelogJsonFromDbWithRedisLock();
}

